package com.share.design.status;

/**
 * author:caifan
 * date:2020/2/5
 */
public class MiddleState extends AbstractState {

    public MiddleState(AbstractState state) {
        this.context = state.context;
        stateName = "中等";
        score = state.score;
    }

    /*public MiddleState(AbstractState state) {
        this.context = state.context;
        stateName = "中等";
        score = state.score;
    }*/

    @Override
    public void checkState() {
        if(score < 60) {
            context.setState(new LowState(this));
        } else if(score >= 90) {
            context.setState(new HighState(this));
        }
    }
}
